<link rel="stylesheet" href="jscript/jquery/tabs/tabs.css" type="text/css" media="print, projection, screen" />
<!-- Additional IE/Win specific style sheet (Conditional Comments) -->
<!--[if lte IE 7]>
<link rel="stylesheet" href="jscript/jquery/tabs/tabs-ie.css" type="text/css" media="projection, screen" />
<![endif]-->

<script src="jscript/jquery/jquery.js" type="text/javascript"></script>
<script src="jscript/jquery/tabs/jquery.tabs-1.4.js" type="text/javascript"></script>
<script type="text/javascript">//<![CDATA[      
   $(document).ready(function() {
       $('#container').tabs();
   });
//]]></script>

<script src="jscript/popup.js" type="text/javascript"></script>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
function init() {
	oEditor = FCKeditorAPI.GetInstance('body');
	ShowHideRoles();
}

function insertLink(field, value_id, value_name) {
	
	ids = value_id.toString().split(',');
	if(ids[1]) {
		l = "[link:"+field+"|"+ids[0]+"|"+ids[1]+"]";
	} else {
		l = "[link:"+field+"|"+ids[0]+"]";
	}
	
	oEditor.CreateLink(l);
}

function ShowHideRoles() {
	var obj = document.getElementById("private");
	if(obj) {
		var val = (obj.checked == true);
		ShowHideDiv('roles_div', val, true);
	}
}

function ShowHideMeta() {
	var obj = document.getElementById('meta_div');
	var val = (obj.style.display == 'none');
	ShowHideDiv('meta_div', val, true);
}

window.onload = init;
</SCRIPT>

{error_msg}

<!-- onSubmit="return Validate(this);" -->
<form action="{action_link}" method="post" name="" id="">
{hidden_fields}


<div id="container">

    <ul class="anchors">
        <li><a href="#section-1">Article</a></li>
        <li><a href="#section-2">{meta_info_msg}</a></li>
        <li><a href="#section-3">Attachments / Related</a></li>
		<li><a href="#section-4">Private</a></li>
		<li class="space">&nbsp;</li>
    </ul>

    <div id="section-1" class="fragment">
		
		<table border=0 width="100%" cellpadding="5" cellspacing="1">
		<tr><td colspan="2" class="tdTitle" style="padding: 0px;"></td></tr>
		
		<tr class="trlighter">
			<td class="tdFormCaption" nowrap valign="top">{category_msg}: {required_sign}</td>
			<td>{category_select}</td>
		</tr>
		<tr class="trlighter">
			<td class="tdFormCaption" nowrap valign="top">{entry_title_msg}: {required_sign}</td>
			<td>
				<tmpl:member_question>
					<textarea cols="" rows="4" name="title" id="title" style="width: 100%">{title}</textarea>
				</tmpl:member_question>
				<tmpl:question>
					<input type="text" name="title" id="title" value="{title}" style="width: 100%">
				</tmpl:question>		
			</td>
		</tr>
		
		<tr class="trlighter">
			<td class="tdFormCaption" nowrap valign="top">
				{entry_body_msg}: {required_sign}
			</td>
			<td>{vck_editor}</td>
		</tr>
		
		<tr class="trlighter">
			<td class="tdFormCaption" nowrap>{sort_order_msg}:</td>
			<td><input type="text" name="sort_order" id="sort_order" value="{sort_order}" style="width: 100px;"></td>
		</tr>		
		
		<tr class="trlighter">
			<td class="tdFormCaption">{status_msg}:</td>
			<td>{status_checkbox}</td>
		</tr>

		</table>

    </div>
	
	
    <div id="section-2" class="fragment">
		
		<table border=0 width="100%" cellpadding="5" cellspacing="1">
		<tr><td colspan="2" class="tdTitle" style="padding: 0px;"></td></tr>
		
		<tr class="trlighter">
			<td class="tdFormCaption" nowrap valign="top">{meta_keywords_msg}:</td>
			<td><textarea cols="80" rows="2" name="meta_keywords" style="width: 100%;">{meta_keywords}</textarea></td>
		</tr>
		
		<tr class="trlighter">
			<td class="tdFormCaption" nowrap valign="top">{meta_description_msg}:</td>
			<td><textarea cols="80" rows="2" name="meta_description" style="width: 100%;">{meta_description}</textarea></td>
		</tr>				
		</table>
		
    </div>
	
	
    <div id="section-3" class="fragment">
       
		<table border=0 width="100%" cellpadding="5" cellspacing="1">
		<tr><td colspan="2" class="tdTitle" style="padding: 0px;"></td></tr>

		<tr class="trlighter" valign="top">
			<td class="tdFormCaption" nowrap>{related_articles_msg}:</td>
			<td>
				
				<a href="javascript:OpenPopup('index.php?module=knowledgebase&page=kb_entry', 'r', 'r');"><b>{add_new_msg}</b></a>
				<br><br>
		
				<table>
				<tmpl:related_row>
					
					<div class="popUpDiv">
						<div style="float: left;">
						<input type="hidden" name="related[]" value="{article_id}"><span>{title}</span>
						</div>
						<div align="right">
						<a id="" href="" onClick="insertLink('article', {article_id}); return false;">{insert_as_link_msg}</a>
						| <a href="" onClick="removeHtml(this, '{sure_common_msg}'); return false;">{delete_msg}</a>
						</div>
					</div>
				
				</tmpl:related_row>
				</table>
				
				<span id="writeroot_article"></span>
						
				</td>
			</tr>
			
			<tmpl:attachment>
			<tr class="trlighter" valign="top">
				<td class="tdFormCaption" nowrap>{attachment_msg}:</td>
				<td>
					
					<a href="javascript:OpenPopup('index.php?module=file&page=file_entry', 'r', 'r');"><b>{add_new_msg}</b></a>
					<br><br>
					
					<tmpl:attachment_row>
					
						<div class="popUpDiv">
							<div style="float: left;">
							<input type="hidden" name="attachment[]" value="{attachment_id}"><span>{filename}</span>
							</div>
							<div align="right">
							<a href="" onClick="insertLink('file', '{attachment_id}'); return false;">{insert_as_link_msg}</a>
							| <a href="" onClick="removeHtml(this, '{sure_common_msg}'); return false;">{delete_msg}</a>
							</div>
						</div>
					
					</tmpl:attachment_row>
					
					<span id="writeroot"></span>
							
				</td>
			</tr>
			</tmpl:attachment>
	
		</table>
		
    </div>
	
    <div id="section-4" class="fragment">
		
		<table border=0 width="100%" cellpadding="5" cellspacing="1">
		<tr><td colspan="2" class="tdTitle" style="padding: 0px;"></td></tr>
		
		<tmpl:private>
		<tr class="trlighter">
			<td class="tdFormCaption" nowrap valign="top">{private_msg}:</td>
			<td>
				<input type="checkbox" name="private" id="private" value="1" {private_options} onClick="ShowHideRoles()"> {yes_msg}
				
				<div id="roles_div" style="display: none">
					<div style="padding: 8px 0px;">{role_access_msg}:&nbsp;&nbsp;
						<a href="javascript:selectAll(true, 'member_role'); void(0);">{all_msg}</a> |
						<a href="javascript:selectAll(false, 'member_role'); void(0);">{none_msg}</a>
					</div>
					
					<select name="member_role[]" id="member_role" size="4" multiple style="WIDTH: 250px">
						{member_role_select}
					</select>
				</div>
				
			</td>
		</tr>
		</tmpl:private>
			
		</table>
		
    </div>	
	
</div>


<div align="center">
	<input type="submit" name="submit" value="{ok_msg}" class="button">
	<input type="button" value="{cancel_msg}" onClick="location.href='{cancel_link}'" class="button">
</div>

</form>


<div id="readroot" style="display: none">
	<div id='d' class="popUpDiv">
		<div style="float: left;">
		<input type="hidden" name="attachment[]" value="" id=""><span>1</span>
		</div>
		<div align="right">
		<a id="" href="" onClick="insertLink('file', this.id); return false;">{insert_as_link_msg}</a>
		| <a href="" onClick="removeHtml(this, '{sure_common_msg}'); return false;">{delete_msg}</a>
		</div>
	</div>
</div>

<div id="readroot_article" style="display: none">
	<div id='d' class="popUpDiv">
		<div style="float: left;">
		<input type="hidden" name="related[]" value=""><span>1</span>
		</div>
		<div align="right">
		<a id="" href="" onClick="insertLink('article', this.id); return false;">{insert_as_link_msg}</a>
		| <a href="" onClick="removeHtml(this, '{sure_common_msg}'); return false;">{delete_msg}</a>
		</div>
	</div>
</div>